<template>
  <div class="main-container">
    <el-row type="flex">
      <div class="left-container">
        <div class="user-info">
          <img src="../../../assets/user-photo.png" alt="" />
          <div v-if="type === 'student' || type === 'captain'">
            <div>{{ userInfo.name }}</div>
            <div>学号 {{ userInfo.num }}</div>
            <div>单位 {{ userInfo.company }}</div>
            <div>专业 {{ userInfo.major }}</div>
          </div>
          <div v-else>
            <div>{{ userInfo.name }}</div>
            <div>单位 {{ userInfo.company }}</div>
            <div>职称 {{ userInfo.title }}</div>
          </div>
        </div>
        <div class="message-center">
          <div class="brief-title">
            <span>消息中心</span>
            <div class="messsage-info">
              <span>2</span>
              <span>2条未读消息</span>
            </div>
          </div>
          <ul>
            <li>
              <span>未读</span>
              <span>2021春毕业主题展将于2021春毕业主题展将于</span>
            </li>
            <li>
              <span></span>
              <span>放假通知</span>
            </li>
          </ul>
        </div>
        <div class="examination-arrangement" v-if="type != 'director' && type != 'battalionChief' && type != 'EducationLeader' && type != 'leadership'">
          <div class="brief-title">
            <span>考试安排</span>
          </div>
          <div class="examination-container">
            <div>
              <div class="examination-date">
                <div>3月25日</div>
                <div>
                  <img src="../../../assets/home/icon-exam-date.png" alt="" />
                  <div>
                    <div>第四周</div>
                    <div>星期四</div>
                  </div>
                </div>
              </div>
              <div class="examination-time-axis">
                <img
                  src="../../../assets/home/icon-exam-time-axis.png"
                  alt=""
                />
                <div></div>
              </div>
              <div class="examination-subject">
                <div>《经济学》</div>
                <div>
                  <div>
                    <img
                      src="../../../assets/home/icon-exam-position.png"
                      alt=""
                    />
                    <span>教室三</span>
                  </div>
                  <div>
                    <img src="../../../assets/home/icon-exam-time.png" alt="" />
                    <span>第1-2节</span>
                  </div>
                </div>
              </div>
            </div>
            <div>
              <div class="examination-date">
                <div>10月5日</div>
                <div>
                  <img src="../../../assets/home/icon-exam-date.png" alt="" />
                  <div>
                    <div>第六周</div>
                    <div>星期一</div>
                  </div>
                </div>
              </div>
              <div class="examination-time-axis">
                <img
                  src="../../../assets/home/icon-exam-time-axis.png"
                  alt=""
                />
                <div></div>
              </div>
              <div class="examination-subject"> 
                <div>《数学课》</div>
                <div>
                  <div>
                    <img
                      src="../../../assets/home/icon-exam-position.png"
                      alt=""
                    />
                    <span>教室六</span>
                  </div>
                  <div>
                    <img src="../../../assets/home/icon-exam-time.png" alt="" />
                    <span>第3-4节</span>
                  </div>
                </div>
              </div>
            </div>
            <div>
              <div class="examination-date">
                <div>8月9日</div>
                <div>
                  <img src="../../../assets/home/icon-exam-date.png" alt="" />
                  <div>
                    <div>第八周</div>
                    <div>星期四</div>
                  </div>
                </div>
              </div>
              <div class="examination-time-axis">
                <img
                  src="../../../assets/home/icon-exam-time-axis.png"
                  alt=""
                />
                <div></div>
              </div>
              <div class="examination-subject">
                <div>《数学课》</div>
                <div>
                  <div>
                    <img
                      src="../../../assets/home/icon-exam-position.png"
                      alt=""
                    />
                    <span>教室四</span>
                  </div>
                  <div>
                    <img src="../../../assets/home/icon-exam-time.png" alt="" />
                    <span>第5节</span>
                  </div>
                </div>
              </div>
            </div>
            <div>
              <div class="examination-date">
                <div>8月9日</div>
                <div>
                  <img src="../../../assets/home/icon-exam-date.png" alt="" />
                  <div>
                    <div>第十周</div>
                    <div>星期四</div>
                  </div>
                </div>
              </div>
              <div class="examination-time-axis">
                <img
                  src="../../../assets/home/icon-exam-time-axis.png"
                  alt=""
                />
                <div></div>
              </div>
              <div class="examination-subject">
                <div>《数学课》</div>
                <div>
                  <div>
                    <img
                      src="../../../assets/home/icon-exam-position.png"
                      alt=""
                    />
                    <span>教室四</span>
                  </div>
                  <div>
                    <img src="../../../assets/home/icon-exam-time.png" alt="" />
                    <span>第6-7节</span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div v-else></div>
      </div>
      <div class="right-container">
        <div class="common-functions">
          <div class="brief-title">
            <span>常用功能</span>
          </div>
          <ul>
            <li
              v-for="(item, index) in commonFunctions"
              :key="index"
              :style="item.style"
              @click="item && item.url ? toLink(item.url) : ''"
            >
              <span>{{ item.name }}</span>
              <div>
                <img :src="item.img" alt="" />
              </div>
            </li>
          </ul>
        </div>
        <div class="block-container">
          <div class="my-function">
            <div class="worksheet"  v-if="type != 'director' && type != 'battalionChief' && type != 'EducationLeader' && type != 'leadership'">
              <div class="worksheet-title">
                <div class="border"></div>
                <div class="text" v-if="type != 'captain'">我的工作表</div>
                <div class="text" v-else>当日课表</div>
              </div>
              <div class="worksheet-content">
                <div class="operate-date">
                  <div class="pre">上一周</div>
                  <div class="date">2021春 第4周 （4月5日-5月1日）</div>
                  <div class="next">下一周</div>
                  <div class="export">
                    <img src="../../../assets/home/icon-export.png" alt="" />
                    <span>导出课表</span>
                  </div>
                </div>
                <div class="table-content" v-if="type != 'captain'">
                  <el-table
                    :data="tableData"
                    :span-method="arraySpanMethod"
                    border
                    class="table-data"
                    row-class-name="row-class"
                    :cell-class-name="cellClassDeal"
                    header-row-class-name="header-row-class"
                    header-cell-class-name="header-cell-class"
                  >
                    <el-table-column
                      prop="title"
                      align="center"
                      class-name=""
                      label-class-name=""
                    >
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">节次\日期</div>
                      </template>
                    </el-table-column>
                    <el-table-column
                      prop="Mon"
                      align="center"
                      class-name=""
                      label-class-name=""
                    >
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">周一</div>
                        <div class="weekend-date">(4月5日)</div>
                      </template>
                      <template slot-scope="scope">
                        <div>{{ scope.row.Mon.name }}</div>
                        <div>{{ scope.row.Mon.position }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Tue" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">周二</div>
                        <div class="weekend-date">(4月6日)</div>
                      </template>
                      <template slot-scope="scope">
                        <div>{{ scope.row.Tue.name }}</div>
                        <div>{{ scope.row.Tue.position }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Wed" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">周三</div>
                        <div class="weekend-date">(4月6日)</div>
                      </template>
                      <template slot-scope="scope">
                        <div>{{ scope.row.Wed.name }}</div>
                        <div>{{ scope.row.Wed.position }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Thu" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">周四</div>
                        <div class="weekend-date">(4月7日)</div>
                      </template>
                      <template slot-scope="scope">
                        <div>{{ scope.row.Thu.name }}</div>
                        <div>{{ scope.row.Thu.position }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Fri" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">周五</div>
                        <div class="weekend-date">(4月8日)</div>
                      </template>
                      <template slot-scope="scope">
                        <div>{{ scope.row.Fri.name }}</div>
                        <div>{{ scope.row.Fri.position }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Sat" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">周六</div>
                        <div class="weekend-date">(4月9日)</div>
                      </template>
                      <template slot-scope="scope">
                        <div>{{ scope.row.Sat.name }}</div>
                        <div>{{ scope.row.Sat.position }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Sun" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">周日</div>
                        <div class="weekend-date">(4月10日)</div>
                      </template>
                      <template slot-scope="scope">
                        <div>{{ scope.row.Sun.name }}</div>
                        <div>{{ scope.row.Sun.position }}</div>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
                <div class="table-content" v-else>
                  <el-table
                    :data="tableData"
                    :span-method="arraySpanMethod"
                    border
                    class="table-data"
                    row-class-name="row-class"
                    :cell-class-name="cellClassDeal"
                    header-row-class-name="header-row-class"
                    header-cell-class-name="header-cell-class"
                  >
                    <el-table-column
                      prop="title"
                      align="center"
                      class-name=""
                      label-class-name=""
                    >
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">课程专业\节次</div>
                      </template>
                    </el-table-column>
                    <el-table-column
                      prop="Mon"
                      align="center"
                      class-name=""
                      label-class-name=""
                    >
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第一节</div>
                      </template>
                      <template slot-scope="scope" >
                        <div>{{ scope.row.Mon.teacherName }}</div>
                        <div>{{ scope.row.Mon.position }}</div>
                        <div>{{ scope.row.Mon.name }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Tue" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第二节</div>
                      </template>
                      <template slot-scope="scope">
                        
                        <div>{{ scope.row.Tue.teacherName }}</div>
                        <div>{{ scope.row.Tue.position }}</div>
                        <div>{{ scope.row.Tue.name }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Wed" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第三节</div>
                      
                      </template>
                      <template slot-scope="scope">
                        
                        <div>{{ scope.row.Wed.teacherName }}</div>
                        <div>{{ scope.row.Wed.position }}</div>
                        <div>{{ scope.row.Wed.name }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Thu" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第四节</div>
                        
                      </template>
                      <template slot-scope="scope">
                        
                         <div>{{ scope.row.Thu.teacherName }}</div>
                        <div>{{ scope.row.Thu.position }}</div>
                        <div>{{ scope.row.Thu.name }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Fri" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第五节</div>
                        
                      </template>
                      <template slot-scope="scope">
                        
                       <div>{{ scope.row.Fri.teacherName }}</div>
                        <div>{{ scope.row.Fri.position }}</div>
                        <div>{{ scope.row.Fri.name }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Sat" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第六节</div>
                       
                      </template>
                      <template slot-scope="scope">
                        
                       <div>{{ scope.row.Sat.teacherName }}</div>
                        <div>{{ scope.row.Sat.position }}</div>
                        <div>{{ scope.row.Sat.name }}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Sun" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第七节</div>
                        
                      </template>
                      <template slot-scope="scope">
                       
                        <div>{{ scope.row.Sun.teacherName }}</div>
                        <div>{{ scope.row.Sun.position }}</div>
                         <div>{{ scope.row.Sun.name }}</div>
                      </template>
                    </el-table-column>

                       <el-table-column prop="eight" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第八节</div>
                        
                      </template>
                      <template slot-scope="scope">
                       
                       <div>{{ scope.row.eight.teacherName }}</div>
                        <div>{{ scope.row.eight.position }}</div>
                         <div>{{ scope.row.eight.name }}</div>
                      </template>
                    </el-table-column>
                       <el-table-column prop="nine" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第九节</div>
                        
                      </template>
                      <template slot-scope="scope">
                        
                       <div>{{ scope.row.nine.teacherName }}</div>
                        <div>{{ scope.row.nine.position }}</div>
                        <div>{{ scope.row.nine.name }}</div>
                      </template>
                    </el-table-column>
                       <el-table-column prop="ten" align="center">
                      <template slot-scope="scope" slot="header">
                        <div class="weekend-name">第十节</div>
                        
                      </template>
                      <template slot-scope="scope">
                        
                       <div>{{ scope.row.ten.teacherName }}</div>
                        <div>{{ scope.row.ten.position }}</div>
                        <div>{{ scope.row.ten.name }}</div>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
              </div>
            </div>
            <div v-else></div>
            <div class="curriculum" v-if="type !== 'captain' && type != 'director'  && type != 'battalionChief' && type != 'EducationLeader' && type != 'leadership'">
              <div class="brief-title">
                <span>我的课程</span>
                <div class="curriculum-search">
                  <span>学期：</span>
                  <el-select
                    v-model="curriculumSearchDate"
                    placeholder="请选择"
                    size="mini"
                    style="width: 91px"
                  >
                    <el-option
                      v-for="(item, index) in dateOptions"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </div>
              </div>
              <el-row class="curriculum-item">
                <el-col
                  :span="12"
                  v-for="(item, index) in curriculums"
                  :key="index"
                >
                  <el-row>
                    <el-col :span="12" class="curriculum-item-left">
                      <div>
                        <img
                          src="../../../assets/home/icon-curriculum.png"
                          alt=""
                        />
                        <span>{{ item.name }}</span>
                      </div>
                      <div>授课教员：{{ item.teacher }}</div>
                    </el-col>
                    <el-col :span="12" class="curriculum-item-right">
                      <div>
                        <img
                          src="../../../assets/home/icon-curriculum-search-green.png"
                          alt=""
                        />
                        <span>查看考核实施计划</span>
                      </div>
                      <div>
                        <img
                          src="../../../assets/home/icon-curriculum-search-blue.png"
                          alt=""
                        />
                        <span>查看成绩及排名</span>
                      </div>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>
            </div>
            <div v-else></div>
          </div>
          <div class="navigation-bar">
            <div class="brief-title">
              <span>导航栏</span>
            </div>
            <div
              v-for="(item, index) in navbars"
              :key="index"
              :class="item.class"
            >
              <div class="nav-title-group">
                <div class="nav-line"></div>
                <div class="nav-title">{{ item.title }}</div>
              </div>
              <div class="nav-container">
                <div
                  v-for="(_item, _index) in item.navs"
                  :key="_index"
                  class="nav-wrapper"
                >
                  <div
                    v-for="(item, index) in _item"
                    :key="index"
                    :class="item.isActive ? 'nav-item active' : 'nav-item'"
                    @click="item && item.url ? toLink(item.url) : ''"
                  >
                    {{ item.name }}
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      type: "student",
      userInfo: {
        name: "高某某",
        num: "526213",
        company: "学员42队",
        major: "财务管理",
      },
      commonFunctions: [
        {
          name: "网上选课",
          img: require("../../../assets/home/icon-function-course.png"),
          style: { color: "#5230E9", background: "#EBE6FF" },
          url: "/teacher/assessmentPlan",
        },
        {
          name: "网上评教",
          img: require("../../../assets/home/icon-function-evaluation-teaching.png"),
          style: { color: "#51AEF6", background: "#E1F2FF" },
          url: "/teacher/assessmentEditPlan",
        },
        {
          name: "登记互联网课",
          img: require("../../../assets/home/icon-function-internet-course.png"),
          style: { color: "#F86900", background: "#FDDCC3" },
          url: "/teacher/assessmentChangePlan",
        },
        {
          name: "填报互联网课成绩",
          img: require("../../../assets/home/icon-function-school-report.png"),
          style: { color: "#F1B104", background: "#FFF6DC" },
          url: "/teacher/assessmentChangePlanDetail",
        },
        {
          name: "查询课程成绩",
          img: require("../../../assets/home/icon-function-query-results.png"),
          style: { color: "#FF3819", background: "#FFD6CF" },
          url: "/teacher/assessmentPlan",
        },
        {
          name: "维护学籍信息",
          img: require("../../../assets/home/icon-function-student-information.png"),
          style: { color: "#02C86C", background: "#DFFFEF" },
          url: "/teacher/assessmentPlan",
        },
      ],
      curriculums: [
        {
          name: "《法律经济学》",
          teacher: "李教员",
        },
        {
          name: "《法律经济学》",
          teacher: "李教员",
        },
        {
          name: "《法律经济学》",
          teacher: "李教员",
        },
        {
          name: "《法律经济学》",
          teacher: "李教员",
        },
      ],
      dateOptions: [
        {
          label: "2020春",
          value: "2020春",
        },
        {
          label: "2020秋",
          value: "2020秋",
        },
      ],
      curriculumSearchDate: "2020春",
      navbars: [
        {
          title: "信息查询",
          class: "",
          navs: [
            [
              { name: "个人信息", isActive: false },
              {
                name: "课程考核实施计划",
                isActive: true,
                url: "/student/assessmentPlan/plan",
              },
            ],
            [
              { name: "培养方案", isActive: false },
              { name: "考试安排", isActive: true,
                url: "/student/examination/examination" },
            ],
            [
              { name: "课表", isActive: false },
              { name: "课程考核成绩", isActive: true },
            ],
            [
              { name: "评教结果查看", 
                isActive: true,
                url: "/student/InformationInquiry/evaluationTeaching", 
              },
              { name: "公共考试成绩", isActive: false},
            ],
          ],
        },
        {
          title: "选修课",
          class: "grep",
          navs: [
            [{ name: "网上选课", isActive: false }],
            [{ name: "登记互联网课", isActive: false }],
          ],
        },
        {
          title: "课程考核与评价",
          class: "yellow",
          navs: [
            [{ name: "申请缓考",
               isActive: true,
               url: "/student/courseAssessment/delayedExam",
            }],
            [{ name: "填报互联网课成绩", isActive: false }],
            [{ name: "在线考试", isActive: false }],
            [{ name: "网上评教", isActive: true, url: "/student/evaluation/evaluation",}],
          ],
        },
        {
          title: "教学运行数据",
          class: "grep",
          navs: [[{ name: "填报教学运行数据", isActive: false }]],
        },
      ],
      tableData: [
        {
          title: "第1节",
          Mon: { id: "fxks", name: "法学考试", position: "教室二" },
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: { id: "yxks", name: "医学考试", position: "教室六" },
          Sat: "",
          Sun: "",
          
        },
        {
          title: "第2节",
          Mon: { id: "fxks", name: "法学考试", position: "教室二" },
          Tue: "",
          Wed: "",
          Thu: { id: "sxk", name: "数学课", position: "" },
          Fri: { id: "yxks", name: "医学考试", position: "教室六" },
          Sat: "",
          Sun: "",
        },
        {
          title: "第3节",
          Mon: { id: "fxks", name: "法学考试", position: "教室二" },
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: "",
          Sun: "",
        },
        {
          title: "第4节",
          Mon: "",
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: "",
          Sun: "",
        },
        {
          title: "第5节",
          Mon: "",
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: { id: "ydyks", name: "印度语考试", position: "教室三" },
          Sun: "",
        },
        {
          title: "第6节",
          Mon: "",
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: { id: "ydyks", name: "印度语考试", position: "教室三" },
          Sun: "",
        },
        {
          title: "第7节",
          Mon: "",
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: "",
          Sun: "",
        },
        {
          title: "第8节",
          Mon: "",
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: "",
          Sun: "",
        },
        {
          title: "第9节",
          Mon: "",
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: "",
          Sun: "",
        },
        {
          title: "第10节",
          Mon: "",
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: "",
          Sun: "",
        },
        {
          title: "备 注",
          Mon: "",
          Tue: "",
          Wed: "",
          Thu: "",
          Fri: "",
          Sat: "",
          Sun: "",
        },
      ],
      MonArr: [],
      MonPos: 0,
      TueArr: [],
      TuePos: 0,
      WedArr: [],
      WedPos: 0,
      ThuArr: [],
      ThuPos: 0,
      FriArr: [],
      FriPos: 0,
      SatArr: [],
      SatPos: 0,
      SunArr: [],
      SunPos: 0,
      colorMap: {
        fxks: "yw-cell",
        sxk: "ty-cell",
        yxks: "sx-cell",
        ydyks: "dl-cell",
      },
    };
  },
  mounted() {
    this.merage();
  },
  methods: {
    cellClassDeal({ row, column, rowIndex, columnIndex }) {
      let dataArray = Object.values(row);
      return this.colorMap[dataArray[columnIndex].id] || "cell-class";
    },
    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 1) {
        const _row_1 = this.MonArr[rowIndex];
        const _col_1 = _row_1 > 0 ? 1 : 0; //如果被合并了_row=0则它这个列需要取消
        return {
          rowspan: _row_1,
          colspan: _col_1,
        };
      } else if (columnIndex === 2) {
        const _row_2 = this.TueArr[rowIndex];
        const _col_2 = _row_2 > 0 ? 1 : 0;
        return {
          rowspan: _row_2,
          colspan: _col_2,
        };
      } else if (columnIndex === 3) {
        const _row_3 = this.WedArr[rowIndex];
        const _col_3 = _row_3 > 0 ? 1 : 0;
        return {
          rowspan: _row_3,
          colspan: _col_3,
        };
      } else if (columnIndex === 4) {
        const _row_4 = this.ThuArr[rowIndex];
        const _col_4 = _row_4 > 0 ? 1 : 0;
        return {
          rowspan: _row_4,
          colspan: _col_4,
        };
      } else if (columnIndex === 5) {
        const _row_5 = this.FriArr[rowIndex];
        const _col_5 = _row_5 > 0 ? 1 : 0;
        return {
          rowspan: _row_5,
          colspan: _col_5,
        };
      } else if (columnIndex === 6) {
        //第三列的合并方法,区
        const _row_6 = this.SatArr[rowIndex];
        const _col_6 = _row_6 > 0 ? 1 : 0;
        return {
          rowspan: _row_6,
          colspan: _col_6,
        };
      } else if (columnIndex === 7) {
        //第三列的合并方法,区
        const _row_7 = this.SunArr[rowIndex];
        const _col_7 = _row_7 > 0 ? 1 : 0;
        return {
          rowspan: _row_7,
          colspan: _col_7,
        };
      }
    },
    merage() {
      //要合并的数组的方法
      this.merageInit();
      for (var i = 0; i < this.tableData.length; i++) {
        if (i === 0) {
          //第一行必须存在
          this.MonArr.push(1);
          this.MonPos = 0;
          this.TueArr.push(1);
          this.TuePos = 0;
          this.WedArr.push(1);
          this.WedPos = 0;
          this.ThuArr.push(1);
          this.ThuPos = 0;
          this.FriArr.push(1);
          this.FriPos = 0;
          this.SatArr.push(1);
          this.SatPos = 0;
          this.SunArr.push(1);
          this.SunPos = 0;
        } else {
          // 判断当前元素与上一个元素是否相同 this.MonPos是MonArr内容的序号
          if (
            this.tableData[i].Mon &&
            this.tableData[i].Mon.id === this.tableData[i - 1].Mon.id
          ) {
            this.MonArr[this.MonPos] += 1;
            this.MonArr.push(0);
          } else {
            this.MonArr.push(1);
            this.MonPos = i;
          }
          if (
            this.tableData[i].Tue &&
            this.tableData[i].Tue.id === this.tableData[i - 1].Tue.id
          ) {
            this.TueArr[this.TuePos] += 1;
            this.TueArr.push(0);
          } else {
            this.TueArr.push(1);
            this.TuePos = i;
          }
          if (
            this.tableData[i].Wed &&
            this.tableData[i].Wed.id === this.tableData[i - 1].Wed.id
          ) {
            this.WedArr[this.WedPos] += 1;
            this.WedArr.push(0);
          } else {
            this.WedArr.push(1);
            this.WedPos = i;
          }
          if (
            this.tableData[i].Thu &&
            this.tableData[i].Thu.id === this.tableData[i - 1].Thu.id
          ) {
            this.ThuArr[this.ThuPos] += 1;
            this.ThuArr.push(0);
          } else {
            this.ThuArr.push(1);
            this.ThuPos = i;
          }

          if (
            this.tableData[i].Fri &&
            this.tableData[i].Fri.id === this.tableData[i - 1].Fri.id
          ) {
            this.FriArr[this.FriPos] += 1;
            this.FriArr.push(0);
          } else {
            this.FriArr.push(1);
            this.FriPos = i;
          }
          if (
            this.tableData[i].Sat &&
            this.tableData[i].Sat.id === this.tableData[i - 1].Sat.id
          ) {
            this.SatArr[this.SatPos] += 1;
            this.SatArr.push(0);
          } else {
            this.SatArr.push(1);
            this.SatPos = i;
          }

          if (
            this.tableData[i].Sun &&
            this.tableData[i].Sun.id === this.tableData[i - 1].Sun.id
          ) {
            this.SunArr[this.SunPos] += 1;
            this.SunArr.push(0);
          } else {
            this.SunArr.push(1);
            this.SunPos = i;
          }
        }
      }
    },
    merageInit() {
      this.MonArr = [];
      this.MonPos = 0;
      this.TueArr = [];
      this.TuePos = 0;
      this.WedArr = [];
      this.WedPos = 0;
      this.ThuArr = [];
      this.ThuPos = 0;
      this.FriArr = [];
      this.FriPos = 0;
      this.SatArr = [];
      this.SatPos = 0;
      this.SunArr = [];
      this.SunPos = 0;
    },
    toLink(url) {
      this.$router.push(url);
    },
  },
};
</script>

<style lang="less" scoped>
@import "../../../styles/home";
</style>